package com.practice.ajCollections010.list.arraylist;

import java.util.ArrayList;

/**
 * 对象转换
 */
public class Convert {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<String>();
        arrayList.add("Hello");
        arrayList.add("World");
        Object[] objects = arrayList.toArray();
        String object = (String) objects[0];
        System.out.println(object);
        String[] array = new String[arrayList.size()];
        String[] strings = arrayList.toArray(array);
        System.out.println("");
    }
}
